package leetcode;

/**
 * @program: datastructureandalogorithm
 * @description:
 * @author: hmx
 * @create: 2021-11-25 21:20
 **/
public class LeetCode458 {

    public int poorPigs(int buckets, int minutesToDie, int minutesToTest) {
        //最大轮次
        int times = minutesToTest / minutesToDie;
        //维度的长度
        int base = times + 1;
        //求出base ^ n >= buckets中n的最小值
        double temp = Math.log(buckets) / Math.log(base);
        return (int)Math.ceil(temp);

    }

}
